<?php
/*
 * Created on 2011-6-20
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
 
function getCategories($viewMode='default'){
	$vocabulary = taxonomy_vocabulary_machine_name_load('knowledge');
	
	$terms = taxonomy_get_tree($vocabulary->vid);
	$output = '';
	
	foreach($terms as $term){
		$parents = $term->parents;
		if('0' == $parents[0]){
			$className = 'topTerm';
		}else{
			$className = 'subTerm';
		}
		$output .= '<a class="'.$className.'" href="'.url('taxonomy/term/' . $term->tid).'">'.$term->name.'</a>&nbsp;&nbsp;';
	}
	return $output;
}
